<template>
  <detailDialog :dialogConfig="dialogConfig" @close="close" :off="off" title="详情">
  </detailDialog>
</template>

<script>
export default {
  name: "orderDetail",
  data(){
      return{
          dialogConfig: {
              tableConfig: {
                  isHaveTable: true,
                  tableData: [],
                  columnConfig: [
                      {label: "商品名称", value: "goodsNmae"},
                      {label: "数量", value: "goodsNum"},
                      {label: "单价", value: "price"},
                  ]
              },
              formConfig: {
                  formData: {},
                  fieldConfig: [
                      {label: "订单编号", value: "providerNo"},
                      {label: "下单时间", value: "createDate", bottomBorder: true, bottomStyle: "bottomStyle"},
                      {label: "供应商编号", value: "purchaseOrderId"},
                      {label: "供应商名称", value: "providerName"},
                      {label: "供应商地址", value: "address"},
                      {label: "座机号码", value: "phone", bottomBorder: true, bottomStyle: "bottomStyle"},
                  ]
              }
          },
      }
  },
  props: {
    off: {
      type: Boolean
    },
    rowData: {
        type: Object
    }
  },
  watch: {
      off(val){
          if(val){
               console.log("this.rowData", this.rowData);
              this.$nextTick(() => {
                  this.dialogConfig.tableConfig.tableData = this.rowData.poGoodsList;
                  this.dialogConfig.formConfig.formData = this.rowData;
                  console.log("this.rowData", this.rowData);
              })
          }
      }
  },
  components: {
    detailDialog: () => import("@/components/detailDialog")
  },
  methods: {
      close(data){
          this.$emit("update:off", false);
      }
  }
};
</script>

<style lang="less" scoped>

</style>